package com.dc.controller;

import com.dc.annotation.Log;
import com.dc.common.ResponseResultVO;
import com.dc.entity.ro.RegionRO;
import com.dc.service.RegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "区域管理")
@RestController
@RequestMapping("/region")
public class RegionController {

    @Resource
    private RegionService regionService;


    @Log(title = "区域管理", businessDesc = "增加")
    @ApiOperation(value = "增加", notes = "增加")
    @PostMapping("/insertRegion")
    public ResponseResultVO insertRegion(@RequestBody RegionRO ro) {
        return regionService.insertRegion(ro);
    }

    @Log(title = "区域管理", businessDesc = "修改")
    @ApiOperation(value = "修改", notes = "修改")
    @PostMapping("/updateRegion")
    public ResponseResultVO updateRegion(@RequestBody RegionRO ro) {
        return regionService.updateRegion(ro);
    }

    @Log(title = "区域管理", businessDesc = "删除")
    @ApiOperation(value = "删除", notes = "删除")
    @GetMapping("/deleteRegion")
    public ResponseResultVO deleteRegion(@RequestParam String id) {
        return regionService.deleteRegion(id);
    }

    @ApiOperation(value = "查询区域列表不分页", notes = "查询区域列表不分页")
    @GetMapping("/selectRegionList")
    public ResponseResultVO selectRegionList() {
        return regionService.selectRegionList();
    }

    @ApiOperation(value = "获取区域列表", notes = "获取区域列表")
    @GetMapping("/selectRegionFloorList")
    public ResponseResultVO selectRegionFloorList() {
        return regionService.selectRegionFloorList();
    }

}
